<?php



class UserAgent extends LibBase{
	
	
	private $agents = array(
						"maxthon"=>"/Maxthon/",
						"tencent"=>"/TencentTraveler/",
						"theworld"=>"/The\sWorld/",
						"sougo"=>"/SE\s1/",
						"360"=>"/360SE/",
						"avant"=>"/Avant\sBrowser/",
						"ie8"=>"/MSIE\s8/",
						"ie6"=>"/MSIE\s6/",
						"ie7"=>"/MSIE\s7/",
						"ie5"=>"/MSIE\s5/",
						"ie9"=>"/MSIE\s9/",
						"navigator"=>"/Navigator/",
						"firefox"=>"/Firefox/",
						"opera"=>"/Opera/",
						"chrome"=>"/Chrome/",
						"safari"=>"/Safari/",
						"other"=>"/./",
				);
	
	public function __construct(){
	}

	public function getAgents(){
		return $this->agents;
	}
	public function check($agent){
		foreach($this->agents as $key=>$val){
			if(preg_match($val,$agent)){
				return $key;
			}
		}
	}
}
